﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Hotnet.Entity;
using Hotnet.Dal.NSDalMusic;

namespace Hotnet.Biz.NSBizMusic
{
	public class BizMusicGroupXMusic : BaseBiz<MusicGroupXMusic>
	{
		private static DalMusicGroupXMusic db = new DalMusicGroupXMusic();
		public BizMusicGroupXMusic() : base(db) { }

		public void DeleteAllByGroupID(int groupId)
		{
			db.DeleteBy(obj => obj.GroupID == groupId);
		}

		public MusicGroupXMusic Get(int groupId, int musicId)
		{
			return db.GetBy(mgxm => mgxm.MusicID == musicId && mgxm.GroupID == groupId);
		}

		public void Delete(int musicId, int groupId)
		{
			db.DeleteBy(mgxm => mgxm.MusicID == musicId && mgxm.GroupID == groupId);
		}
	}
}
